#include <bits/stdc++.h>
#define re register
#define int long long
#define Add(a,b) (((a) + (b)) % mod)
#define chAdd(a,b) (a = Add(a,b))

using namespace std;

const int N = 1e5 + 10;
const int mod = 1e9 + 7;
int x,y;
int dp[N];

inline int read(){
    int r = 0,w = 1;
    char c = getchar();
    while (c < '0' || c > '9'){
        if (c == '-') w = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9'){
        r = (r << 3) + (r << 1) + (c ^ 48);
        c = getchar();
    }
    return r * w;
}

signed main(){
    freopen("op.in","r",stdin);
    freopen("op.out","w",stdout);
    x = read(),y = read(); dp[x] = 1;
    for (re int i = x + 1;i <= y;i++){
        dp[i] = dp[i - 1];
        if (i % 2 == 0) chAdd(dp[i],dp[i / 2]);
    } printf("%lld",dp[y]);
    return 0;
}